 #ifndef TOOL_CONTROLLER_H

//--------------------------------------------------------
//		DEFINITIONS
//--------------------------------------------------------

#define TOOL_CONTROLLER_H


//--------------------------------------------------------
//		INCLUDES
//--------------------------------------------------------

#include "MeshRenderer.h"
#include "Subdivider.h"
#include "ModelFrame.h" 


//--------------------------------------------------------
//		BUNDLED TYPES
//--------------------------------------------------------

enum Tool {
	NO_TOOL,
	LOOP,
	CATMULL,
	SUBDIVISION,
	CONNECTIVITY_INSPECT,
	WEIGHT_INSPECT,
	SHARP_FEATURES
};


//--------------------------------------------------------
//		CLASS: ToolController
//--------------------------------------------------------

class ToolController : public QObject
{
	Q_OBJECT

public:

	ToolController() { }

	~ToolController(){};

	void		setSubdivider	( Subdivider* );	// sets the subdivision scheme that will be used by the tools
	void		setActiveTool	( Tool );			// sets the active tool as specified by the parameter
	void		useActiveTool	( );				// performs the function of the currently active tool
	ModelFrame* openMeshFile	( QWidget* );		// opens mesh file, loads mesh into model locator

protected:
		
	// Nothing here yet

signals:

	void modelLoaded		( );

public slots:

	void setSelection( const Selection* ); // sets the current selection as sepcified in the parameter

private:

	//Class attributes
	Tool		        activeTool;	// current tool being used
	Subdivider*			subdivider;	// the subdivision scheme used by the tools
	const Selection*	selection;  // parts of a mesh that are currently selected

	//Helper methods
	void doSubdivision				( );	// performs subdivision on the current selection
	void doConnectivityInspection	( );	// performs connectivity inspection on current selection 
	void doWeightInspection			( );	// performs weight inspection on current selection
	void doSharpEdgeMarking			( );	// performs sharp edge marking on current selection
};

#endif